using System;
using System.Collections.Generic;
using System.Text;
using FlatRedBall;
using FlatRedBall.Input;
using FlatRedBall.AI.Pathfinding;
using FlatRedBall.Graphics.Animation;
using FlatRedBall.Graphics.Particle;

using FlatRedBall.Graphics.Model;
using FlatRedBall.Math.Geometry;
using FlatRedBall.Math.Splines;

using Cursor = FlatRedBall.Gui.Cursor;
using GuiManager = FlatRedBall.Gui.GuiManager;

#if FRB_XNA || SILVERLIGHT
using Keys = Microsoft.Xna.Framework.Input.Keys;
using Vector3 = Microsoft.Xna.Framework.Vector3;
using Texture2D = Microsoft.Xna.Framework.Graphics.Texture2D;
#endif

using Gnome.Entities;
using FlatRedBall.Instructions;
using Microsoft.Xna.Framework.Input;
using Gnome.Engine;

namespace Gnome.Screens
{
	public partial class EndScreen
	{
        // This right here makes me feel like a dirty, dirty girl.
        // -Lucas
        private int popup_counter = 180;
        private bool isPaused = false;

		public void CustomInitialize()
		{

		}

		public void CustomActivity(bool firstTimeCalled)
		{
            if (popup_counter <= 0)
            {
                if (!isPaused)
                {
                    //InstructionManager.PauseEngine();
                    isPaused = true;
                    ScreenManager.CurrentScreen.LoadPopup(typeof(Gnome.Screens.ScoreScreen).FullName, true);
                }
                if (CustomInputManager.isMenuSelect() || CustomInputManager.isMenuCancel())
                {
                    MoveToScreen(typeof(Gnome.Screens.MainMenu).FullName);
                }
            }
            else
            {
                popup_counter--;
                if (CustomInputManager.isMenuSelect() || CustomInputManager.isMenuCancel())
                {
                    isPaused = true;
                    ScreenManager.CurrentScreen.LoadPopup(typeof(Gnome.Screens.ScoreScreen).FullName, true);
                }
            }

		}

		public void CustomDestroy()
		{


		}

        private static void CustomLoadStaticContent(string contentManagerName)
        {


        }

	}
}
